<template>
  <div class="GemWithdrawal">
    <!-- 提现认证 -->
    <div v-if="index == 1">
      <div class="imgBox">
        <img src="../assets/image/tixianrenzheng.png" alt="" />
      </div>
      <!-- <span>实名认证并添加收款信息才能提现哦~</span> -->
      <span>{{ errorMsg }}</span>
      <div class="btn">
        <p @click="interaction">提现认证</p>
      </div>
    </div>

    <!-- 提现成功 -->
    <div v-if="index == 2">
      <div class="imgBox">
        <img src="../assets/image/tixianchengg.png" alt="" />
      </div>
      <span>提现成功</span>
      <div class="btn">
        <p @click="interaction">获取更多宝石</p>
      </div>
    </div>

    <!-- 提现失败 -->
    <div v-if="index == 3">
      <div class="imgBox">
        <img src="../assets/image/tixianshibai.png" alt="" />
      </div>
      <span>提现失败</span>
      <b>{{ errorMsg }}</b>
      <div class="btn">
        <p @click="interaction">获取更多宝石</p>
      </div>
    </div>

    <!-- 提现失败实名认证 -->
    <!-- <div v-if="index == 4">
      <div class="imgBox">
        <img src="../assets/image/tixianshibai.png" alt="" />
      </div>
      <span>提现失败</span>
      <b>请检查认证信息是否为本人</b>
      <div class="btn">
        <p>提现认证</p>
      </div>
    </div> -->

    <!-- 正在审核 -->
    <div v-if="index == 4">
      <div class="imgBox">
        <img src="../assets/image/shenhe.png" alt="" />
      </div>
      <span>正在审核</span>
    </div>

    <!-- 信誉值不足 -->
    <div v-if="index == 5">
      <div class="imgBox">
        <img src="../assets/image/xinyuzhi.png" alt="" />
      </div>
      <span>心动值不足</span>
      <div class="btn">
        <p @click="pushAboutHeartbeat">如何获取心动值</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      index: 6,
      errorMsg: "",
      errorCode: "",
    };
  },
  methods: {
    //交互
    interaction() {
      let that = this;
      var u = navigator.userAgent,
        app = navigator.appVersion;
      var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //android终端或者uc浏览器
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      if (isAndroid) {
        window.android.interaction(parseInt(that.index));
      } else if (isiOS) {
        window.webkit.messageHandlers.interaction.postMessage(that.index);
      }
    },
    pushAboutHeartbeat() {
      this.$router.push("/aboutHeartbeat");
      //  this.$router.push("/ServiceAgreement");
    },
  },
  created() {
    if (this.$route.query.status) {
      this.index = this.$route.query.status;
    }
    if (this.$route.query.errorMsg) {
      this.errorMsg = this.$route.query.errorMsg;
    }
  },
};
</script>

<style lang="less" scoped>
.GemWithdrawal {
  // background: #19162a;
  padding: 0px 25px;
  height: 100%;
  .imgBox {
    display: flex;
    justify-content: center;
    padding-top: 50px;
    img {
      width: 40%;
      height: 100%;
    }
  }
  span {
    color: #333333;
    text-align: center;
    display: flex;
    justify-content: center;
    font-size: 15px;
    margin-top: 10px;
  }
  b {
    display: flex;
    justify-content: center;
    font-size: 13px;
    margin-top: 2px;
    color: #999999;
  }
  .btn {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    p {
      width: 80%;
      height: 50px;
      background: linear-gradient(90deg, #d853ff 0%, #7439ff 100%);
      border-radius: 30px;
      color: white;
      font-size: 18px;
      display: flex;
      justify-content: center;
      font-weight: bold;
      align-items: center;
    }
  }
}
</style>